import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Login from '@/views/login'


import NProgress from 'nprogress'
import 'nprogress/nprogress.css'

Vue.use(Router)
NProgress.configure({ showSpinner: false });

//不需要认证的路由
const routes = [
  {
    path: '/',
    component: Login
  }
]

//注册路由
const router = new Router({
  routes: routes
})

// 路由跳转前验证
// router.beforeEach((to, from, next) => {
//
//   // 开启进度条
//   // NProgress.start();
//
//   //判断用户是否登陆
//
// })

// 路由跳转后验证
router.afterEach(() => {
  // NProgress.done(); // 结束Progress
})


export default router
